package com.zhangtai.modules.service.leave;


import com.zhangtai.modules.entity.leave.LeaveInfoEntity;
import com.zhangtai.utils.PageResult;
import com.zhangtai.utils.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;
import java.util.Map;


/**
 * 
 *
 * @author chenshun
 * @email sunlightcs@gmail.com
 * @date 2020-09-07 19:36:18
 */

public interface LeaveInfoService {

    @GetMapping("/findLeaveInfoList")
    @ApiOperation(value = "分页查询")
    PageResult queryPage(@RequestParam(value = "keyword", required = false) String keyword,
                         @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
                         @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize);

    PageResult getLeaveList(@RequestParam(value = "oid", required = false) Long oid,
                            @RequestParam(value = "startTime", required = false) String startTime,
                            @RequestParam(value = "endTime", required = false) String endTime,
                            @RequestParam(value = "dealStatus", required = false) List<Long> dealStatus,
                            @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
                            @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize);

    PageResult getLeaveListSystem(@RequestParam(value = "orgIds", required = false) List<Long> orgIds,
                                         @RequestParam(value = "unitIds", required = false) List<Long> unitIds,
                                         @RequestParam(value = "jobIds", required = false) List<Long> jobIds,
                                  @RequestParam(value = "orgId", required = false) List<Long> orgId,
                                         @RequestParam(value = "type", required = false) String type,
                                         @RequestParam(value = "name", required = false) String name,
                                         @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
                                         @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize);

    List<LeaveInfoEntity> getSameTimeResult(@RequestParam(value = "startTime", required = false) String startTime,
                                            @RequestParam(value = "endTime", required = false) String endTime,
                                            @RequestParam(value = "oid", required = false) Long oid);

    Map<String,Object> getLeaveInfo(@RequestParam(value = "id", required = false) Long id);


    @GetMapping("/infoLeaveInfo")
    @ApiOperation(value = "根据id查找")
    LeaveInfoEntity getByIdE(@RequestParam("id") Long id);

    @PostMapping("/saveLeaveInfo")
    @ApiOperation(value = "保存")
    R saveE(@RequestBody LeaveInfoEntity entity);

    @PostMapping("/updateLeaveInfo")
    @ApiOperation(value = "修改")
    R updateByIdE(@RequestBody LeaveInfoEntity entity);

    @GetMapping("/deleteOneLeaveInfo")
    @ApiOperation(value = "根据ID删除")
    R removeOneById(@RequestParam("id") Long id);

    @PostMapping("/deleteLeaveInfos")
    @ApiOperation(value = "根据ID集合删除")
    R removeByIdsE(@RequestBody List<Long> ids);
}

